package com.bruce.ssm.model;


import java.io.Serializable;

public class ReturnObject implements Serializable {
    /**
     * http请求返回状态,true正常，false异常
     */
    private boolean status;
    /**
     * 异常代码，可以是0X001，也可以是com.supermap...
     */
    private String code;
    /**
     * 异常消息
     */
    private String message;
    /**
     * 返回数据
     */
    private Object datas;

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getDatas() {
        return datas;
    }

    public void setDatas(Object datas) {
        this.datas = datas;
    }

    public ReturnObject() {
        this.status = true;
        this.message = "操作成功";
    }

    public ReturnObject(final boolean status) {
        this.status = status;
        this.message = status ? "操作成功" : "操作失败";
    }

    public ReturnObject(boolean status, String message) {
        this(status);
        this.message = message;
    }

    public ReturnObject(boolean status, String code, String message) {
        this(status);
        this.message = message;
        this.code = code;
    }

    public ReturnObject(final Object datas) {
        this(true);
        this.datas = datas;
    }

}
